'use strict';
const db = uniCloud.database()
exports.main = async (event, context) => {
  const collection = db.collection('company_collect');
  let whereMap = {
  	'company':event.company,
  	'createTime': dbCmd.gte(todayStart).and(dbCmd.lte(todayEnd))
  };
  const res = await collection
  	.aggregate()
  	.match(whereMap)
  	.group({
  		_id: '$advice',
  		data: $.sum(1)
  	})
  	.end();
  return {
  	data: res.data || []
  };
};
